package com.gexin.model.enums;

public enum MemberInfoEnum {

    FIRST_LEVEL(1, "游客"),
    //异常 返回码范围 400 -419 业务无关异常
    SECOND_LEVEL(2, "会员"),
    //服务端异常
    THIRD_LEVEL(3, "推广者");

    private int code;
    private String desc;

    MemberInfoEnum(int code, String desc)
    {
        this.code = code;
        this.desc = desc;
    }

       public int getCode()
       {
           return code;
       }

       public void setCode(int code)
       {
           this.code = code;
       }

       public String getDesc()
       {
           return desc;
       }

       public void setDesc(String desc)
       {
           this.desc = desc;
       }

        public static String getValue(int code) {
            for (MemberInfoEnum ele : values()) {
                if(ele.getCode()==code) return ele.getDesc();
            }
            return null;
        }
}
